\(\int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx\) [223]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 28, antiderivative size = 38 \[ \int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx=-\frac {2 \sqrt {a} \arcsin \left (\frac {\sqrt {a} \sin (e+f x)}{\sqrt {a-a \cos (e+f x)}}\right )}{f} \]

[Out]

-2*arcsin(sin(f*x+e)*a^(1/2)/(a-a*cos(f*x+e))^(1/2))*a^(1/2)/f

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {2853, 222} \[ \int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx=-\frac {2 \sqrt {a} \arcsin \left (\frac {\sqrt {a} \sin (e+f x)}{\sqrt {a-a \cos (e+f x)}}\right )}{f} \]

[In]

Int[Sqrt[a - a*Cos[e + f*x]]/Sqrt[-Cos[e + f*x]],x]

[Out]

(-2*Sqrt[a]*ArcSin[(Sqrt[a]*Sin[e + f*x])/Sqrt[a - a*Cos[e + f*x]]])/f

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 2853

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/Sqrt[(d_.)*sin[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[-2/f, Su
bst[Int[1/Sqrt[1 - x^2/a], x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, d, e, f}, x]
&& EqQ[a^2 - b^2, 0] && EqQ[d, a/b]

Rubi steps \begin{align*} \text {integral}& = -\frac {2 \text {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{a}}} \, dx,x,\frac {a \sin (e+f x)}{\sqrt {a-a \cos (e+f x)}}\right )}{f} \\ & = -\frac {2 \sqrt {a} \arcsin \left (\frac {\sqrt {a} \sin (e+f x)}{\sqrt {a-a \cos (e+f x)}}\right )}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.45 \[ \int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx=\frac {2 \arcsin \left (\sqrt {-\cos (e+f x)}\right ) \sqrt {a-a \cos (e+f x)} \cot \left (\frac {1}{2} (e+f x)\right )}{f \sqrt {1+\cos (e+f x)}} \]

[In]

Integrate[Sqrt[a - a*Cos[e + f*x]]/Sqrt[-Cos[e + f*x]],x]

[Out]

(2*ArcSin[Sqrt[-Cos[e + f*x]]]*Sqrt[a - a*Cos[e + f*x]]*Cot[(e + f*x)/2])/(f*Sqrt[1 + Cos[e + f*x]])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(82\) vs. \(2(32)=64\).

Time = 3.37 (sec) , antiderivative size = 83, normalized size of antiderivative = 2.18

method result size
default \(\frac {2 \sqrt {-\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sqrt {-a \left (\cos \left (f x +e \right )-1\right )}\, \arctan \left (\sqrt {-\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\right ) \left (\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )}{f \sqrt {-\cos \left (f x +e \right )}}\) \(83\)

[In]

int((a-cos(f*x+e)*a)^(1/2)/(-cos(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2/f*(-cos(f*x+e)/(1+cos(f*x+e)))^(1/2)*(-a*(cos(f*x+e)-1))^(1/2)*arctan((-cos(f*x+e)/(1+cos(f*x+e)))^(1/2))/(-
cos(f*x+e))^(1/2)*(cot(f*x+e)+csc(f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 164, normalized size of antiderivative = 4.32 \[ \int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx=\left [\frac {\sqrt {-a} \log \left (\frac {4 \, \sqrt {-a \cos \left (f x + e\right ) + a} {\left (2 \, \cos \left (f x + e\right )^{2} + 3 \, \cos \left (f x + e\right ) + 1\right )} \sqrt {-a} \sqrt {-\cos \left (f x + e\right )} - {\left (8 \, a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) + a\right )} \sin \left (f x + e\right )}{\sin \left (f x + e\right )}\right )}{2 \, f}, \frac {\sqrt {a} \arctan \left (\frac {\sqrt {-a \cos \left (f x + e\right ) + a} \sqrt {-\cos \left (f x + e\right )} {\left (2 \, \cos \left (f x + e\right ) + 1\right )}}{2 \, \sqrt {a} \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right )}{f}\right ] \]

[In]

integrate((a-a*cos(f*x+e))^(1/2)/(-cos(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[1/2*sqrt(-a)*log((4*sqrt(-a*cos(f*x + e) + a)*(2*cos(f*x + e)^2 + 3*cos(f*x + e) + 1)*sqrt(-a)*sqrt(-cos(f*x
+ e)) - (8*a*cos(f*x + e)^2 + 8*a*cos(f*x + e) + a)*sin(f*x + e))/sin(f*x + e))/f, sqrt(a)*arctan(1/2*sqrt(-a*
cos(f*x + e) + a)*sqrt(-cos(f*x + e))*(2*cos(f*x + e) + 1)/(sqrt(a)*cos(f*x + e)*sin(f*x + e)))/f]

Sympy [F]

\[ \int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx=\int \frac {\sqrt {- a \left (\cos {\left (e + f x \right )} - 1\right )}}{\sqrt {- \cos {\left (e + f x \right )}}}\, dx \]

[In]

integrate((a-a*cos(f*x+e))**(1/2)/(-cos(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(-a*(cos(e + f*x) - 1))/sqrt(-cos(e + f*x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 420 vs. \(2 (32) = 64\).

Time = 0.41 (sec) , antiderivative size = 420, normalized size of antiderivative = 11.05 \[ \int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx=\frac {\sqrt {-a} {\left (\log \left (4 \, \sqrt {\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )^{2} + 4 \, \sqrt {\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )^{2} + 8 \, {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + 4\right ) - \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + \sqrt {\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1} {\left (\cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )^{2} + \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )^{2}\right )} + 2 \, {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{4}} {\left (\cos \left (f x + e\right ) \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \sin \left (f x + e\right ) \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )\right )}\right )\right )}}{2 \, f} \]

[In]

integrate((a-a*cos(f*x+e))^(1/2)/(-cos(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

1/2*sqrt(-a)*(log(4*sqrt(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)*cos(1/2*arctan2(sin
(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))^2 + 4*sqrt(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e)
+ 1)*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))^2 + 8*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 +
 2*cos(2*f*x + 2*e) + 1)^(1/4)*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + 4) - log(cos(f*x + e
)^2 + sin(f*x + e)^2 + sqrt(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)*(cos(1/2*arctan2
(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))^2 + sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))^2) + 2*
(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*(cos(f*x + e)*cos(1/2*arctan2(sin(2*f
*x + 2*e), cos(2*f*x + 2*e) + 1)) + sin(f*x + e)*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)))))/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (32) = 64\).

Time = 0.50 (sec) , antiderivative size = 83, normalized size of antiderivative = 2.18 \[ \int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx=-\frac {4 \, \sqrt {a} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + \frac {2 \, {\left (2 \, \sqrt {2} - \sqrt {-\tan \left (\frac {1}{4} \, f x + \frac {1}{4} \, e\right )^{4} + 6 \, \tan \left (\frac {1}{4} \, f x + \frac {1}{4} \, e\right )^{2} - 1}\right )}}{\tan \left (\frac {1}{4} \, f x + \frac {1}{4} \, e\right )^{2} - 3}\right )}\right ) \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}{f} \]

[In]

integrate((a-a*cos(f*x+e))^(1/2)/(-cos(f*x+e))^(1/2),x, algorithm="giac")

[Out]

-4*sqrt(a)*arctan(-1/2*sqrt(2)*(sqrt(2) + 2*(2*sqrt(2) - sqrt(-tan(1/4*f*x + 1/4*e)^4 + 6*tan(1/4*f*x + 1/4*e)
^2 - 1))/(tan(1/4*f*x + 1/4*e)^2 - 3)))*sgn(sin(1/2*f*x + 1/2*e))/f

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {a-a \cos (e+f x)}}{\sqrt {-\cos (e+f x)}} \, dx=\int \frac {\sqrt {a-a\,\cos \left (e+f\,x\right )}}{\sqrt {-\cos \left (e+f\,x\right )}} \,d x \]

[In]

int((a - a*cos(e + f*x))^(1/2)/(-cos(e + f*x))^(1/2),x)

[Out]

int((a - a*cos(e + f*x))^(1/2)/(-cos(e + f*x))^(1/2), x)